package lab02.test36;

public class Test36 {
    public static void main(String[] args) {

        Student [] student = new Student[5];

        student[0] = new Undergraduate("张三","本科生",
                90,95,100);
        student[1] = new Undergraduate("李四","本科生",
                80,85,90);
        student[2] = new Postgraduate("王五","研究生",
                82,85,88);
        student[3] = new Undergraduate("赵六","本科生",
                75,82,87);
        student[4] = new Postgraduate("陈七","研究生",
                80,82,84);

        System.out.println("姓名"+"\t\t"+"类型"+"\t\t"+"成绩");
        System.out.println("");

        for (int i = 0;i < student.length;i++){
            System.out.print(student[i].name+"\t\t"+student[i].calss+"\t");
            if (student[i].calss.equals("本科生")){
                student[i].Undergraduate();
            }else if (student[i].calss.equals("研究生")){
                student[i].Postgraduate();
            }
        }

    }
}